<template>
  <div class="container">
    <div>{{obj.name}}</div>
    <div>{{obj.age}}</div>
    <button @click="updatename">修改数据</button>
  </div>
</template>

<script>
import { reactive } from 'vue';
export default {
  name: 'App',
  setup () {
    // const obj = {
    //   name: 'ls',
    //   age: 18
    // }
    const obj = reactive({
      name: 'ls',
      age: 18
    })
    const updatename = () => {
      console.log('updatename');
      obj.name = 'ww'
    }
    return { obj, updatename }
  }
}
</script>

<style>
</style>